* Consider a system consisting of two parallel components
* A and B. The failure rates of A and B are lambdaA and 
* lambdaB, respectively. There is a single repairman with 
* the FCFS scheduling policy for repair. As soon as either
* one of A or B fails, the repairman begins to repair it if not
* busy. If the other component fails before the repair work on
* the first one is completed, the second component has to wait
* until the repairman is free. The rapairman will take exactly
* DA and DB time to repair component A and B, respectively.
* This problem is explained in "Queueing Networks and 
* Markov Chains" by G. Bolch, S. Greiner, H. de Meer and 
* K. S. Trivedi, chapter 13, John Wiley, New York, 1998.
* Find the steady state probabilities, steady state availability
* for the parameters lambdaA = lambdaB = 0.01, DA=DB=5.

format 8

bind 
n 25
DA 5
DB 5
lambdaA 1/100
lambdaB 1/100
uDA n/DA
uDB n/DB
end

mrgp par_rep
1 @ 2 exp(lambdaA)
2 @ 1 Erlang(n, uDA)
1 @ 3 exp(lambdaB)
3 @ 1 Erlang(n, uDB)
2 - 4 exp(lambdaB)
4 @ 3 Erlang(n, uDA)
3 - 5 exp(lambdaA)
5 @ 2 Erlang(n, uDB)
reward
1 1
2 1
3 1
end

echo Steady State Probabilities:
expr prob(par_rep,1), prob(par_rep,2)
expr prob(par_rep,3), prob(par_rep,4)
expr prob(par_rep,5)

echo Steady State Availability:
expr exrss(par_rep)
end



